using System;
using NUnit.Framework;
using Impact.Controllers;
using Impact.Model.Objects;
using System.Collections.Generic;
using Impact.Views;

namespace Impact.UnitTests
{
    [TestFixture]
    public class UTRss : TestFixtureBase
    {


        [Test]
        public void GetRssFeed()
        {
            string channelName = string.Empty;
            string userName = "unit test";
            string ipAddress = "127.0.0.1";

            MockHandler handler = new MockHandler();
            RssController controller = new RssController( handler );

            RssFeed feed = controller.GetRssFeed( channelName, userName, ipAddress );

            Assert.IsNotNull( feed );
            Assert.AreEqual( 2, feed.channel.Count );
            // sorted by date descending
            //Assert.AreEqual( "two", items[0].Title );
            //Assert.AreEqual( "one", items[1].Title );


        }


    }

    class MockHandler : IImpactHandler
    {
        #region IImpactHandler Members

        public string ResolveRelativeUrl( string url )
        {
            return url;
        }

        #endregion
    }
}
